home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 February
/
Macworld (1999-02).dmg
/
Shareware World
/
Comms & Internet
/
PPPop2.0.1-PPC
/
PPPop Scripts
/
Script Samples
/
Mail_Check Script
< prev
Wrap
Text File
|
1998-10-17
|
3KB
|
114 lines
-- Mail Check Version
-- Requires:
-- Eudora 1.5.1 or later (Copyright QUALCOMM Incorporated)
-- PPPop 1.4.1 or later
--
-- Based upon "Check The Mail" Copyright © 1994 Mark Alldritt
--
-- Modified by Rob Friefeld <mailto:friefeld@deltanet.com> 8/3/96
-- The PPP driver should be set to quiet mode for unattended operation.
-- Recommended to use Okey-Dokey or another utility to answer dialogs automatically
set Setting to true -- Set to False if you are not going to launch Eudora from a setting file
if Setting then set SettingFile to "Capella:Internet:deltanet:Delta Mail:Eudora Settings" as alias
-- This has to be an !!ABSOLUTE PATH!! to your setting file. This example uses my path, not yours.
try
-- Get Eudora started so it is ready to receive script commands
if Setting then
tell application "Finder"
open SettingFile
end tell
else
tell application "Eudora Pro" to run
end if
tell application "PPPop2"
run
activate
set PPPWasUp to false
if (PPP up) then
set PPPWasUp to true
end if
if not (PPPWasUp) then
-- set some PPPop options for unattended operation, if you wish
copy launcher switch to holdlauncher
set launcher switch to false
connect
-- waste some time while the connection is established. This is needed because MacPPP
-- operates asynchronously.
set i to 1
repeat while (i < 5000 and not (PPP up)) -- may need to increase on fast Macs
set i to i + 1
end repeat
if not (PPP up) then
error "PPP link not opened"
end if
end if
end tell
-- with timeout of 9999 seconds
tell application "Eudora Pro"
activate
connect with sending and checking
end tell
-- end timeout
-- Got the mail.
-- If the PPP connection was up already, assume the user is present
-- at the computer to deal with the dialog. Since the default choice is "don't Close"
-- the script will be well-behaved if an extension like Okey-Dokey is running.
if PPPWasUp then
display dialog ¬
"Do you want to close the PPP link?" & return & ¬
"" buttons {"Close", "Don't Close"} default button "Don't Close" with icon caution
if button returned of the result = "close" then
tell application "PPPop2"
activate
disconnect
end tell
end if
else
tell application "PPPop2"
activate
disconnect
set launcher switch to holdlauncher
end tell
end if
-- Finish with Eudora in front
tell application "Eudora Pro"
activate
end tell
on error errorString
-- Something went wrong. Let the user know, and offer to close the connection
-- Default is close, since if an error is encountered, we want Okey-Dokey
-- to make the right choice.
tell application "PPPop2"
activate
if (PPP up) then
if not (PPPWasUp) then
disconnect
set launcher switch to holdlauncher
set sound to holdsound
set server to holdserver
end if
else
display dialog "Can't check the mail " & return & "(" & errorString & ")." & return & ¬
"Close PPP link?" & return & ¬
"" buttons {"Close", "Don't Close"} default button "Close" with icon caution
if button returned of the result = "Close" then
disconnect
end if
end if
end tell
end try